import { network } from '@/utils';
import { ShelvesToHeapListParams, ChangeStatusParams } from './data';

import { basic } from '../../../../../config/Apis';

export async function queryShelvesToHeapList(params: ShelvesToHeapListParams) {
  return network.get(basic.shelf_list, {
    params,
  });
}

export async function operChangeStatus(params: ChangeStatusParams) {
  return network.put(basic.shelf, { data: params });
}

export async function operActionClearNumber(params: any) {
  const { type, ...query } = params;
  return network.post(type === 1
    ? basic.shelf_clearPkgNum
    : basic.shelf_clearAllPkgNum, { data: query });
}
